package cn.dnui_cjy529.dnuifood_16110100529.model;


import cn.dnui_cjy529.dnuifood_16110100529.Fragment.HomeFragment;
import retrofit2.Call;

import cn.dnui_cjy529.dnuifood_16110100529.iface.ShopIface;
import cn.dnui_cjy529.dnuifood_16110100529.listener.OnRetrofitListener;
import cn.dnui_cjy529.dnuifood_16110100529.service.ShopService;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public abstract class ShopModel extends BaseModel implements ShopIface {
    private Retrofit retrofit;
    private ShopService service;
    public ShopModel(){
        super();
        service=retrofit.create(ShopService.class);
    }
    @Override
    public void getAllShops(OnRetrofitListener listener) {
        Call call=service.getAllShops();
        bindCallback(call,listener,1);
    }

    @Override
    public void getFoodByShop(String shop_id, OnRetrofitListener listener) {
        Call call =service.getFoodByShop(shop_id);
        bindCallback(call,listener,2);
    }



    @Override
    public void getShopById(String shop_id, OnRetrofitListener listener) {
        Call call =service.getShopById(shop_id);
        bindCallback(call,listener,3);
    }
    public void bindCallback(Call call, OnRetrofitListener listener, int i) {
    }
    @Override
    public void userCollectShop(String collect) {

    }
}

